package com.imooc.annotationAccount.dao;

import org.springframework.jdbc.core.support.JdbcDaoSupport;

/**
 * @program: nettydemo
 * @description:
 * @author: jason.jia
 * @create: 2018-07-03 18:54
 **/
public class AccountDaoImpl extends JdbcDaoSupport implements AccountDao {

    @Override
    public void outMoney(String out, Double money) {
        String sql = "update account set money = money - ? where name = ?";
        this.getJdbcTemplate().update(sql,money,out);
    }

    @Override
    public void inMoney(String in, Double money) {
        String sql = "update account set money = money + ? where name = ?";
        this.getJdbcTemplate().update(sql,money,in);
    }
}
